<?xml version="1.0"?>

<f:view
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
>
	<h:head />
	<h:body>
		<h:form>
			<p:menuButton id="actionsTab" value="Actions">
				<p:menuitem id="editDetails" onclick="editBookDetailsDIalog.show()" value="Edit Book Details">
					<f:setPropertyActionListener target="#{search}" value="#{library.editBookBean}"></f:setPropertyActionListener>
				</p:menuitem>
			</p:menuButton>
		</h:form>
		<p:dialog id="editBookDetails" widgetVar="editBookDetailsDIalog" resizable="true" modal="true" height="200" width="600" header="Edit Book Details">
			<p:panelGrid columns="2">
				<p:column>
					<h:outputText value="Book Title"/>
				</p:column>
				<p:column>
					<h:outputText value="#{library.libraryBackingBean.bookTitle}"/>
				</p:column>
				
				<p:column>
					<h:outputText value="Author"/>
				</p:column>
				<p:column>
					<h:inputText value="#{library.libraryBackingBean.author}"/>
				</p:column>
				
				<p:column colspan="2">
					<h:commandButton actionListener="#{library.editBookImpl}"/>
				</p:column>
			</p:panelGrid>
		</p:dialog>
	</h:body>
</f:view>